package com.own.core.object.lookup.address;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.own.core.html.form.dropDown.DropDown;
import com.own.core.object.lookup.Lookup;

@Entity
@DiscriminatorValue("City")
public class City extends Lookup {

	@DropDown
	Country country;

	public City() {
	}

	public City(String name) {
		this.name = name;
	}

	public City(String name, Country country) {
		this.name = name;
		this.country = country;
	}

	// bi-directional many-to-one association to Role
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "look_id")
	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

}
